<?php
/**
 * App class wraps url parsing and instantiates controller
 * @author Joe Minichino <joe@dsforge.net>
 * 
 */

class App {
    function  __construct() {
        throw new Exception("Don't instantiate the app please....", "00");
    }

    public static function run(){
        
        $segments = getUriSegments();
        $action = $segments[2] ? $segments[2] : "main";
        $method = $segments[3] ? $segments[3] : "index";
        show($segments);
        require_once "$action.php";
        /*
        $ctrl_name = ucfirst($action);
        $controller = new $ctrl_name();
        $controller->$method();
        
        if(isAjax()==false) {  Debug::flush(); }
        */
        print "ok";
    }

}
